
package cn.edu.neu.oasis;

import java.rmi.Remote;
import java.rmi.RemoteException;

public interface Manager extends Remote {
	
	/**
	 * @param username
	 * @param passwd
	 *            register a new user
	 * @return the Result Of register,success or the reason
	 *         of failure
	 * @throws RemoteException
	 */
	public String register(String username, String passwd)
			throws RemoteException;
	
	/**
	 * @param username
	 * @param passwd
	 * @param anotherUser
	 * @param start
	 * @param end
	 * @param title
	 *            use the given arguments to build a new meeting
	 * @return the result of adding a meeting, success or the reason of the
	 *         failure
	 * @throws RemoteException
	 */
	public String add(String username, String passwd, String anotherUser,
			long start, long end, String title) throws RemoteException;
	
	/**
	 * @param username
	 * @param passwd
	 * @param start
	 * @param end
	 *            query the meetings between the start and end date
	 * @return the meetings between the start and end date or the reason of
	 *         failure
	 * @throws RemoteException
	 */
	public String query(String username, String passwd, long start, long end)
			throws RemoteException;
	
	/**
	 * @param username
	 * @param passwd
	 * @param mid
	 *            delete a meeting by giving an id of the meeting
	 * @return the result of deleting a meeting,success or the reason of failure
	 * @throws RemoteException
	 */
	public String delete(String username, String passwd, long mid)
			throws RemoteException;
	
	/**
	 * @param username
	 * @param passwd
	 *            delete all the meetings of a user
	 * @return the result of clearing the meeting list, success or the reason of
	 *         failure
	 * @throws RemoteException
	 */
	public String clear(String username, String passwd) throws RemoteException;
	
	/**
	 * @param username
	 * @param password
	 *            detect the password matches the user name or not
	 * @return the result of logging-in, success or the reason of failure
	 * @throws RemoteException
	 */
	public boolean login(String username, String password)
			throws RemoteException;
}
